/**
 * Created by Toma on 2016/12/9.
 */
var content = `My name is Cici, find...`;
var getName = function () {
    return 'cici';
};

console.log(`hello ${content}`);
console.log(`hello ${getName()}`);

function test(template, name, age) {
    console.log(template);
    console.log(name);
    console.log(age);
}

const myname = 'cici';
var getage = function () {
    return 18;
};

test`My name is ${myname}, i'm ${getage()}`;

export class Hello {

}

// 参数类型
var alias:any = 'xixi'; // 指定任何值
var mynode:string = "cate";
var age:number = 1;
var man:boolean = true;

function mytest():void {
} // 表示不会返回任何值
function mytest2(name:string):string {
    return name;
} // 必须有返回值 且类型


// 自定义类型
class Person {
    name:string;
    age:number;
}

var cici:Person = new Person();
cici.name = 'cicicici';
cici.age = 18;


// =================================
// 为方法变量指定默认值
// ? 表示可选参数
function cav(c, b?:string, a:string = 'cici') {
    console.log(c);
    console.log(b || 'coco');
    console.log(a);
}
cav('titi');


